package com.ruoyi.project.system.doctor.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.doctor.mapper.TableDoctorMapper;
import com.ruoyi.project.system.doctor.domain.TableDoctor;
import com.ruoyi.project.system.doctor.service.ITableDoctorService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 医师信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-09-13
 */
@Service
public class TableDoctorServiceImpl implements ITableDoctorService 
{
    @Autowired
    private TableDoctorMapper tableDoctorMapper;

    /**
     * 查询医师信息
     * 
     * @param id 医师信息主键
     * @return 医师信息
     */
    @Override
    public TableDoctor selectTableDoctorById(Long id)
    {
        return tableDoctorMapper.selectTableDoctorById(id);
    }

    /**
     * 查询医师信息列表
     * 
     * @param tableDoctor 医师信息
     * @return 医师信息
     */
    @Override
    public List<TableDoctor> selectTableDoctorList(TableDoctor tableDoctor)
    {
        return tableDoctorMapper.selectTableDoctorList(tableDoctor);
    }

    /**
     * 新增医师信息
     * 
     * @param tableDoctor 医师信息
     * @return 结果
     */
    @Override
    public int insertTableDoctor(TableDoctor tableDoctor)
    {
        tableDoctor.setCreateTime(DateUtils.getNowDate());
        return tableDoctorMapper.insertTableDoctor(tableDoctor);
    }

    /**
     * 修改医师信息
     * 
     * @param tableDoctor 医师信息
     * @return 结果
     */
    @Override
    public int updateTableDoctor(TableDoctor tableDoctor)
    {
        tableDoctor.setUpdateTime(DateUtils.getNowDate());
        return tableDoctorMapper.updateTableDoctor(tableDoctor);
    }

    /**
     * 批量删除医师信息
     * 
     * @param ids 需要删除的医师信息主键
     * @return 结果
     */
    @Override
    public int deleteTableDoctorByIds(String ids)
    {
        return tableDoctorMapper.deleteTableDoctorByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除医师信息信息
     * 
     * @param id 医师信息主键
     * @return 结果
     */
    @Override
    public int deleteTableDoctorById(Long id)
    {
        return tableDoctorMapper.deleteTableDoctorById(id);
    }
}
